package com.atkxp.stustatusmasystem.controller;

import com.atkxp.stustatusmasystem.pojo.*;
import com.atkxp.stustatusmasystem.pojo.Class;
import com.atkxp.stustatusmasystem.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.jws.WebParam;
import java.util.LinkedList;
import java.util.List;

/**
 * @author user
 * @declaration
 * @create 2023/5/26-21:19
 */
@Controller
public class JumpController {

    @Autowired
    public StudentService studentService;

    @Autowired
    public TeacherService teacherService;

    @Autowired
    public MajorService majorService;

    @Autowired
    public ClassService classService;

    @Autowired
    public ApplicationService applicationService;

    @RequestMapping("towelcome")
    public String toWelcome(Model model) {
        Long teacherCount = teacherService.getTeacherCount();
        Long studentCount = studentService.getStudentCount();
        Long adminCount = teacherService.getAdminCount();
        model.addAttribute("teacherCount1", teacherCount);
        model.addAttribute("studentCount1", studentCount);
        model.addAttribute("adminCount1", adminCount);
        return "welcome";
    }

    @RequestMapping("toShowMsg")
    public String toShowMsg(String msg, Model model) {
        model.addAttribute("msg", msg);
        return "showMsg";
    }

}
